home *** CD-ROM | disk | FTP | other *** search
/ Netware Super Library / Netware Super Library.iso / utility / tsrc29 / tsr.doc < prev    next >
Text File  |  1989-05-05  |  36KB  |  797 lines

  1.                         TSR Utilities Version 2.9
  2.                              Kim Kokkonen
  3.                           TurboPower Software
  4.                                5/4/89
  5.  
  6. Introduction
  7. ------------------------------------------------------------------------------
  8. The TSR Utilities are a collection of programs useful for managing DOS memory,
  9. particularly for managing memory-resident programs, also known as TSR's. TSR
  10. stands for "Terminate and Stay Resident". The most popular use of these
  11. programs is for removing TSR's from memory without rebooting the PC. There are
  12. many other uses, however, especially if you are a software developer.
  13.  
  14. The TSR Utilities have grown to include 11 programs. Here's a quick overview
  15. of each one:
  16.  
  17.   MARK     marks a position in memory above which TSR's can be released.
  18.   RELEASE  removes TSR's from memory.
  19.   FMARK    performs the same function as MARK but uses less memory.
  20.   MARKNET  like MARK, but saves a more complete picture of system status.
  21.   RELNET   removes TSR's marked with MARKNET.
  22.   WATCH    a TSR itself, it keeps records of other TSR's.
  23.   DISABLE  disables or reactivates TSR's, leaving them in memory.
  24.   RAMFREE  shows how much RAM memory is available.
  25.   MAPMEM   shows what memory resident programs are loaded.
  26.   DEVICE   shows what device drivers are loaded.
  27.   EATMEM   uses up memory for controlled program testing.
  28.  
  29. These programs are described in detail in the following sections. If you
  30. haven't used them before, be sure to read the documentation: All of the
  31. programs are command line driven, and unexpected events may occur if you just
  32. start typing the program names at the DOS command line.
  33.  
  34. The documentation for version 2.8 has been revised substantially. If you're
  35. familiar with previous versions of the TSR Utilities, the most important
  36. change in v2.8 is the addition of MARKNET and RELNET. These new programs allow
  37. marking and releasing the Novell NetWare shell, as well as other "problem
  38. TSR's" that could not be released successfully in previous versions.
  39.  
  40.  
  41. MARK, FMARK, and RELEASE
  42. ------------------------------------------------------------------------------
  43. MARK.COM and RELEASE.EXE are used to remove TSR's from memory, without
  44. requiring a system reboot. In their simplest form, MARK and RELEASE are used
  45. as follows:
  46.  
  47. 1. Run MARK before installing your TSR(s). This marks the current position in
  48. memory and stores information that RELEASE will later need to restore the
  49. system. A common place to call MARK is in your AUTOEXEC.BAT file.
  50.  
  51. 2. Install whatever TSR's you want, using the normal method for each TSR.
  52.  
  53. 3. To remove those TSR's from memory, run RELEASE. This will release all of
  54. the memory above (and including) the last MARK, and will restore the system to
  55. the state at the time the MARK was made.
  56.  
  57. There are a number of variations of this simple method. First, MARKs can be
  58. stacked in memory, as shown in the following hypothetical batch file:
  59.  
  60.     MARK
  61.     TSR1
  62.     MARK
  63.     TSR2
  64.     MARK
  65.     TSR3
  66.  
  67. Each call to RELEASE releases memory above and including the last MARK. In
  68. this example, the first call to RELEASE would remove TSR3 and the last MARK
  69. from memory, the second call would remove TSR2 and its MARK, and so on.
  70.  
  71. MARK and RELEASE may be called using a command line parameter. The parameter
  72. specifies a "mark name" and allows releasing TSR's to a specific point in
  73. memory. Consider the following example:
  74.  
  75.     MARK TSR1
  76.     TSR1
  77.     MARK TSR2
  78.     TSR2
  79.     MARK TSR3
  80.     TSR3
  81.  
  82. This loads the three TSR's just as in the previous example. However, if
  83. RELEASE were called like this
  84.  
  85.     RELEASE TSR2
  86.  
  87. then both TSR2 and TSR3 would be removed from memory. Note that the use of
  88. such a name does not allow just a single layer of TSR's to be removed (just
  89. TSR2, for example). RELEASE always removes all TSR's including and beyond the
  90. one named.
  91.  
  92. A mark name is any string up to 126 characters long. The name may not include
  93. white space (blanks or tabs). Case (upper or lower) is not significant when
  94. matching mark names.
  95.  
  96. When named marks are used as in this example, calling RELEASE without
  97. specifying a mark name will still remove the last TSR from memory. Assuming
  98. that TSR1, TSR2, and TSR3 are still in memory, typing just RELEASE would
  99. remove TSR3 and the last mark. It is possible to change this behavior by using
  100. "protected marks", which can be released only by explicitly specifying their
  101. names. A protected mark is placed by giving it a name that starts with an
  102. exclamation point, '!'. Consider the following:
  103.  
  104.     MARK TSR1
  105.     TSR1
  106.     MARK TSR2
  107.     TSR2
  108.     MARK !TSR3
  109.     TSR3
  110.  
  111. Here !TSR3 specifies a protected mark. Typing just RELEASE would produce an
  112. error message "No matching marker found, or protected marker encountered". The
  113. same error would occur after entering the command RELEASE TSR2. When this
  114. error occurs, RELEASE does not remove any TSR's from memory.
  115.  
  116. The only way to remove TSR3 in this case is by entering
  117.  
  118.     RELEASE !TSR3
  119.  
  120. Each time a MARK is placed in memory, it consumes about 1600 bytes of RAM
  121. space, which is used to store a copy of the system interrupt vector table and
  122. other information with which RELEASE can later restore the system. Although
  123. 1600 bytes isn't very much, we can reduce this memory usage by storing the
  124. information in a disk file rather than in memory. FMARK.COM is a variation on
  125. MARK that does just that. You can call FMARK at any time that you would call
  126. MARK. FMARK uses only about 150 bytes of memory.
  127.  
  128. All calls to FMARK must include a command line parameter to specify the name
  129. of the file:
  130.  
  131.     FMARK [d:][directory]filename
  132.  
  133. You should generally specify a complete pathname for the mark file. When you
  134. later call RELEASE, you must give it the identical pathname, regardless of
  135. what the current directory happens to be at the time. For example, if you
  136. specified the following file mark
  137.  
  138.     FMARK C:\TEST\TEST.MRK
  139.  
  140. then the following calls to RELEASE would generate an error:
  141.  
  142.     RELEASE TEST.MRK
  143.     RELEASE C:TEST.MRK
  144.  
  145. even if the current directory on drive C: was \TEST. The only way to call
  146. RELEASE is with
  147.  
  148.     RELEASE C:\TEST\TEST.MRK
  149. or
  150.     release c:\test\test.mrk
  151.  
  152. RELEASE can use either type of mark: in-memory or on-disk. Note that RELEASE
  153. treats marks placed with FMARK just like protected marks. That is, they can be
  154. released only by explicitly naming them. (This is a change in behavior from
  155. versions of RELEASE prior to 2.8. The change is especially important when net
  156. marks, described below, are also in use.)
  157.  
  158. Consider the following example:
  159.  
  160.     MARK
  161.     TSR1
  162.     FMARK C:\MARKS\TSR2.MRK
  163.     TSR2
  164.  
  165. Typing just RELEASE in this situation generates the warning message "No
  166. matching marker found, or protected marker encountered", because the file mark
  167. is treated like a protected mark.
  168.  
  169. TSR2 can be removed from memory by entering
  170.  
  171.     RELEASE C:\MARKS\TSR2.MRK
  172.  
  173. RELEASE deletes the mark file when it has finished.
  174.  
  175. RELEASE has several command line options to modify its behavior. The following
  176. table lists the options, which must start with a slash, '/', or a hyphen, '-'.
  177.  
  178.     /E         do NOT access EMS memory.
  179.     /K         release memory, but keep the mark in place.
  180.     /S chars   stuff string (<16 chars) into keyboard buffer on exit.
  181.     /?         write this help screen.
  182.  
  183. None of the options is required for normal use of RELEASE.
  184.  
  185. /E is made available for systems running early, buggy EMS (expanded memory)
  186. drivers that don't correctly implement all of the EMS 3.2 system calls. Don't
  187. use it unless you have an EMS-related problem during or after running RELEASE.
  188.  
  189. /K is useful when you will be releasing and reloading a TSR repeatedly. With
  190. it, you avoid the need to replace the mark each time the TSR is released.
  191. Using /K in combination with a file mark also prevents RELEASE from deleting
  192. the mark file.
  193.  
  194. /S followed by at least one space and then a short string (15 characters or
  195. fewer) tells RELEASE to stuff this string into the keyboard buffer just before
  196. exiting. RELEASE automatically adds a carriage return to the end of the
  197. string.
  198.  
  199. To explain why the /S option is important, we must digress a moment. Let's
  200. assume that you normally keep SideKick loaded, but that you must unload it in
  201. order to have enough memory free to run Lotus 1-2-3. It would seem reasonable
  202. to write a little batch file like this:
  203.  
  204.    RELEASE SK
  205.    LOTUS
  206.    MARK SK
  207.    SK
  208.  
  209. which would remove the previously loaded SideKick from memory, run Lotus, and
  210. then load SideKick again. Unfortunately, this won't work!
  211.  
  212. The reason is complicated to explain. It must suffice here to say that DOS
  213. batch files trap memory, and the memory freed by a call to RELEASE does not
  214. truly become available until the current batch file ends.
  215.  
  216. Now perhaps the need for the /S option becomes clear. We can split the
  217. previous batch file into two:
  218.  
  219.   batch1:
  220.     RELEASE SK /S BATCH2
  221.  
  222.   batch2:
  223.     LOTUS
  224.     MARK SK
  225.     SK
  226.  
  227. The first batch file releases the memory and stuffs the characters
  228. 'BATCH2<Enter>' into the keyboard buffer. When the batch file ends, the
  229. released memory becomes available. DOS automatically reads the keystrokes
  230. waiting in the buffer and starts up the second batch file, which runs Lotus
  231. and later reloads SideKick.
  232.  
  233. To keep things simple, the /S option pokes the specified keystrokes directly
  234. into the system keyboard buffer. As a result, the number of keystrokes is
  235. limited to 15 (not counting the <Enter> key, which RELEASE adds automatically).
  236. This always allows enough keys to start another batch file, however, and the
  237. new batch file can take over from there.
  238.  
  239. RELEASE detects when it is releasing memory within a batch file. It writes a
  240. warning message to that effect, but continues processing anyway under the
  241. assumption that the batch file is about to end. You can ignore the warning if
  242. you've already taken account of DOS's memory management behavior within batch
  243. files.
  244.  
  245. MARK and RELEASE are capable of removing many, but not all, TSR's from memory.
  246. The TSR's that cannot be released fall into two categories: those that cannot
  247. be released without specific internal knowledge of the TSR, and those that can
  248. be released by storing additional general information about the system.
  249.  
  250. The most common examples of TSR's that we can't be released without internal
  251. knowledge are those that cooperate with other TSR's in memory. Examples
  252. include Microsoft's MOUSE driver and its associated MENU program; and the
  253. program CED with its "user-installed commands" such as KEYIN, HS, RAW, and
  254. others. These programs can be released, but only if all the cooperating
  255. partners are released at the same time. CED is well-behaved in that it
  256. provides a built-in command (KILL) to release its partners. MOUSE is not so
  257. flexible, though.
  258.  
  259. Other TSR's modify well-defined areas of DOS memory that MARK and FMARK simply
  260. don't record. Examples of such TSR's include the Novell NetWare workstation
  261. shell and certain DOS utilities like MODE and SHARE. To deal with these
  262. programs we've written the MARKNET and RELNET utilities, described in the next
  263. section, which store just about every imaginable DOS data area, including some
  264. that are undocumented by MicroSoft. If you have trouble removing a particular
  265. TSR with MARK/RELEASE, try using MARKNET/RELNET instead.
  266.  
  267. WARNING: you should not use either RELEASE or RELNET to try to release most
  268. disk caching programs. If you do so, part of the information that should be
  269. stored on disk will never make it, and you may end up with a corrupted disk
  270. as a result. If you know that the disk cache uses a "write-through" algorithm
  271. (which guarantees that all writes immediately go to disk), or if the disk
  272. cache has a "flush the cache" command, then it may be safe to release the
  273. cache.
  274.  
  275. WARNING: you cannot release the DOS 3.3 FASTOPEN or APPEND TSR's. These TSR's
  276. patch internal DOS data areas that cannot be reliably located by even MARKNET
  277. and RELNET.
  278.  
  279.  
  280. MARKNET and RELNET
  281. ------------------------------------------------------------------------------
  282. Use of these utilities is very similar to that described in the preceding
  283. section. MARKNET is analogous to FMARK, and RELNET is like RELEASE. Because
  284. MARKNET stores so much information about the system, it writes it to a disk
  285. file in order to reduce its own memory usage. Command line syntax for MARKNET
  286. and RELNET is:
  287.  
  288.   MARKNET [d:][directory]filename
  289.   RELNET  [d:][directory]filename [options]
  290.  
  291. The main command line parameter to each program specifies the name of the file
  292. where the mark information will be stored. We refer to this file as the net
  293. mark file. A complete pathname should be specified for the net mark file.
  294. RELNET's pathname must exactly match that passed to MARKNET, with the
  295. exception of case.
  296.  
  297. Note that MARKNET and RELNET may be used in almost any situation where FMARK
  298. and RELEASE are used. MARKNET saves all of the same system information as does
  299. FMARK, but it goes further to store information such as the device driver
  300. chain, DOS internal variable areas, DOS system file tables, DOS environment,
  301. communications port status, and other information. Nevertheless, MARKNET and
  302. RELNET were written primarily because of the large demand to release the
  303. NetWare shell. We'll refer to NetWare specifically in the following and
  304. provide an example of how to load and release it.
  305.  
  306. The only new restriction for using MARKNET is that the system must be running
  307. DOS version 3.0 or later. MARKNET depends on the format of certain internal
  308. DOS data structures that were quite different in DOS version 2.
  309.  
  310. Like FMARK, MARKNET leaves a small (144-192) byte mark in memory, and writes a
  311. disk file to store the system status. MARKNET's file varies in size, but is
  312. typically 3-4K bytes. The size depends on the number of device drivers, the
  313. value of the 'FILES=' directive in CONFIG.SYS, and other implementation
  314. details of DOS.
  315.  
  316. Do not attempt to redirect the output of MARKNET. Doing so will waste at least
  317. one file handle that cannot be recovered later by RELNET.
  318.  
  319. Marks placed with MARK, FMARK, and MARKNET may be mixed in the same system.
  320. RELEASE treats all marks placed with MARKNET as protected; such marks may be
  321. released only by calling RELNET explicitly. Consider the following example:
  322.  
  323.   MARK
  324.   TSR1
  325.   FMARK C:\MARKS\TSR2.MRK
  326.   TSR2
  327.   MARKNET C:\MARKS\TSR3.MRK
  328.   TSR3
  329.  
  330. Entering RELEASE by itself would generate a warning and do nothing else.
  331. Entering RELEASE C:\MARKS\TSR2.MRK would generate the same warning. The only
  332. way to get all three of these TSR's out of memory would be to enter the
  333. following commands in sequence:
  334.  
  335.   RELNET C:\MARKS\TSR3.MRK
  336.   RELEASE C:\MARKS\TSR2.MRK
  337.   RELEASE
  338.  
  339. RELNET has options to control how much of the system state it restores.
  340. Several of the options match those of RELEASE; new ones are needed because of
  341. the additional information that MARKNET stores. RELNET accepts the following
  342. options:
  343.  
  344.   /C        do NOT restore the communications ports.
  345.   /E        do NOT access EMS memory.
  346.   /K        release memory, but keep the mark in place.
  347.   /P        do NOT restore DOS environment.
  348.   /R        revector 8259 interrupt controller to powerup state.
  349.   /S chars  stuff string (<16 chars) into keyboard buffer on exit.
  350.   /T        do NOT reset the system timer chip.
  351.   /V        verbose: show each step of the restore.
  352.   /?        write help screen.
  353.  
  354. None of these options is required in order to release the NetWare workstation
  355. shell.
  356.  
  357. /C keeps RELNET from restoring the communications state of the system (as
  358. encoded in the 8250 async chip and the 8259 programmable interrupt
  359. controller). Because both of these chips provide readable registers, MARKNET
  360. is able to store an accurate picture of the communications state when the mark
  361. is stored; RELNET can restore the state to exactly what it was. Therefore, the
  362. /C option should be needed rarely, perhaps only on newer PS/2 models that
  363. don't use the 8250 as a communications controller. (We haven't tested MARKNET
  364. and RELNET on a PS/2 model 50z. Use caution if you have such a system.) Note
  365. that MARKNET stores information only about COM1 and COM2.
  366.  
  367. /E is made available for systems running early, buggy EMS drivers that don't
  368. correctly implement all of the EMS 3.2 system calls. Don't use it unless you
  369. have an EMS-related problem during or after running RELNET.
  370.  
  371. /K is useful when you will be releasing and reloading a TSR repeatedly. With
  372. it, you avoid the need to replace the mark each time the TSR is released.
  373. Using /K prevents RELNET from deleting the net mark file.
  374.  
  375. /P keeps RELNET from restoring the DOS environment, which it normally does
  376. because NetWare modifies the DOS PATH. In some cases, other changes to the
  377. environment should not be undone; use the /P switch only when such changes
  378. must be preserved.
  379.  
  380. /R may be useful for unloading task-switching utilities that "revector" the
  381. hardware interrupt controller. Use it only if it solves a problem.
  382.  
  383. /S followed by at least one space and then a short string (15 characters or
  384. fewer) tells RELNET to stuff this string into the keyboard buffer just before
  385. exiting. RELNET automatically adds a carriage return to the end of the string.
  386. See the discussion of /S in the preceding section for more details.
  387.  
  388. /T keeps RELNET from resetting the system timer chip to its default rate,
  389. which it does by default.
  390.  
  391. /V activates additional status reporting during the release and may provide
  392. useful information in cases when RELNET isn't working.
  393.  
  394. The following is a simplified version of a NetWare LOGIN.BAT file with support
  395. for releasing the shell:
  396.  
  397.   rem place the mark
  398.       marknet C:\NET\NETWARE.MRK
  399.  
  400.   rem load the NetWare shell TSR's
  401.       ipx
  402.       net3
  403.   rem optional portions of the shell
  404.   rem netbios
  405.   rem int2f
  406.  
  407.   rem switch to login drive and log in
  408.       F:
  409.       login USERNAME
  410.  
  411. The items in uppercase, at least, will need to be customized for a given user
  412. and workstation.
  413.  
  414. NetWare could then be released with the following batch file:
  415.  
  416.   rem let the server know we're leaving
  417.       z:\public\logout
  418.   rem restore the workstation
  419.       relnet C:\NET\NETWARE.MRK
  420.  
  421.  
  422. WATCH and DISABLE
  423. ------------------------------------------------------------------------------
  424. WATCH.COM is a resident program that keeps track of other memory resident
  425. programs. As a TSR goes resident, WATCH updates a data area in memory that
  426. contains information about what interrupt vectors were taken over. This
  427. information can later be used by MAPMEM and DISABLE to show more details about
  428. interrupts than normally available.
  429.  
  430. Installation of WATCH.COM is optional. All of the TSR Utilities except DISABLE
  431. can be used whether or not WATCH is installed.
  432.  
  433. If you want to use it, WATCH.COM should be installed as the first TSR in your
  434. AUTOEXEC.BAT file. WATCH uses about 4000 bytes of memory when it is installed.
  435. Most of this memory holds various information about the TSR's installed in the
  436. system -- it includes two copies of the interrupt vector table, and a data
  437. area containing a list of the interrupt vectors taken over by each TSR. This
  438. information is used by DISABLE to deactivate and reactivate TSR's without
  439. removing them from memory.
  440.  
  441. With DISABLE.EXE, you can disable and reenable specified memory resident
  442. programs without removing them from memory. Its function is analogous to that
  443. performed by REFEREE from Persoft, although DISABLE has neither a fancy user
  444. interface nor an option to work from within other programs. DISABLE can allow
  445. conflicting TSR's to coexist, and it can let you run applications whose
  446. keystrokes conflict with those of TSR's already loaded. DISABLE also provides
  447. a small bonus in that it can be used to detect the presence of a particular
  448. TSR in memory, thus allowing the design of semi-intelligent batch files.
  449.  
  450. In order to use DISABLE, you must install WATCH.COM as the first memory
  451. resident program in your system. WATCH keeps the detailed information about
  452. each memory resident program that DISABLE uses to later control them.
  453.  
  454. Like the other TSR Utilities, DISABLE is operated from the command line. You
  455. specify a single TSR by its name (if you are running DOS 3.0 or later) or by
  456. its address as determined from a MAPMEM report (described below). If you
  457. specify an address, immediately precede the address with a dollar sign "$" and
  458. specify the address in hexadecimal.
  459.  
  460. The name specified for a TSR is the one reported by MAPMEM in the "owner"
  461. column. If the owner column reports "N/A", then you must instead specify the
  462. address from the "PSP" column.
  463.  
  464. DISABLE accepts the following command line syntax:
  465.  
  466.   DISABLE TSRname|$PSPaddress [options]
  467.  
  468. Options may be preceded by either / or -. Valid options
  469. are as follows:
  470.  
  471.      /A     reactivate the specified TSR.
  472.      /C     check for the presence of the specified TSR.
  473.      /?     write a help screen.
  474.  
  475. If no option is specified, DISABLE will disable the named TSR.
  476.  
  477. Examples of usage:
  478.  
  479.   DISABLE SK              disables SideKick
  480.   DISABLE SK /A           reenables SideKick
  481.   DISABLE SK /C           checks for the presence of SideKick
  482.   DISABLE $2F2E           disables the TSR at address 2F2E (hex)
  483.  
  484. DISABLE sets the DOS ERRORLEVEL in order to return status information to a
  485. batch file. It uses the following values of errorlevel:
  486.  
  487.   0       success: TSR is present, was disabled, or was reenabled.
  488.   1       TSR is present, but no action was required to enable or disable it.
  489.   2       TSR is not present in memory.
  490.   254     invalid command line.
  491.   255     severe error.
  492.  
  493. WARNING: you cannot use DISABLE to deactivate SideKick Plus, whose swapping
  494. technique is incompatible with DISABLE.
  495.  
  496.  
  497. MAPMEM, RAMFREE, and DEVICE
  498. ------------------------------------------------------------------------------
  499. These three utilities provide status information about DOS memory usage. They
  500. don't make active changes to the system like RELEASE and DISABLE do.
  501.  
  502. MAPMEM.EXE displays a map of DOS memory. It shows the resident programs, how
  503. much memory they use, and what interrupt vectors each one controls. MAPMEM
  504. also shows information about expanded and extended memory when available.
  505.  
  506. MAPMEM writes to the standard output -- hence, the output can be printed or
  507. stored to a file by using DOS redirection.
  508.  
  509. Here is an example of MAPMEM output:
  510.  
  511.  PSP  blks bytes owner    command line        chained vectors
  512. ----- ---- ----- -------- ------------------- ------------------------------
  513. 0008   1   34240 config
  514. 1228   2    3536 command
  515. 1315   2    3888 WATCH    TSR WATCHER         16 21 27
  516. 140A   2   22128 CED      N/A                 1B 21 64
  517. 1973   1     144 N/A      C:\MARK\PS.MRK
  518. 197D   2     736 PSKEY    S3                  09 15
  519. 19AD   2   68400 PS       /B:0 /E:1 /R:0 /... 01 03 06 0D
  520. 2A62   2    1504 MARK     test                00 3F
  521. 2AC2   2   10384 EATMEM   10
  522. 2D4D   2  469808 free
  523.  
  524. block   bytes   (Expanded Memory)
  525. -----   ------
  526.     1  1048576
  527.  free  1048576
  528. total  2097152
  529.                 (Extended Memory)
  530. total   379240
  531.  
  532. "PSP" stands for Program Segment Prefix. This is the physical address,
  533. specified in hexadecimal, where the program was loaded. If you're running DOS
  534. 2.x, you'll need to use an address from this column to pass to DISABLE.
  535.  
  536. "Blks" is the number of memory blocks DOS is using to manage the program. This
  537. will typically be two: one for the program itself and another for the
  538. environment that stores the program name, the DOS path, and other environment
  539. variables.
  540.  
  541. "Bytes" is the number of bytes of memory, specified in decimal, allocated to
  542. the program.
  543.  
  544. The "owner" column shows the name of the program that allocated the block. An
  545. "N/A" in this column means either that the program deallocated its environment
  546. to reduce memory usage (as shown on the fifth row of the report) or that the
  547. system is running DOS 2.x, where the owner names are simply not available.
  548.  
  549. "Command line" shows the command line entered when the TSR was originally
  550. loaded. Some TSR's overwrite their command line with other code or data in
  551. order to save memory space. MAPMEM can usually detect this behavior and will
  552. display "N/A" in the command line column when it does.
  553.  
  554. The last column will be titled with either "chained vectors" or "hooked
  555. vectors". When WATCH is loaded, "chained" will appear; otherwise, "hooked"
  556. will. The numbers in this column indicate what interrupt vectors the TSR has
  557. grabbed. Without WATCH, MAPMEM must use a heuristic technique to identify
  558. the owner of each vector; don't be surprised if you see some ridiculous
  559. looking vector numbers. With WATCH, MAPMEM should report an accurate list for
  560. each TSR, and should show the complete chain of control for each interrupt.
  561.  
  562. MAPMEM indicates disabled TSR's by displaying the word "disabled" in the
  563. interrupt vector column of the report.
  564.  
  565. The expanded memory report shows each allocated block of expanded memory, as
  566. well as the free and total EMS space. When extended memory is available,
  567. MAPMEM shows just the total amount available. The extended memory report is
  568. not highly reliable because of the lack of a standardized method for
  569. allocating extended memory space. Some applications that use extended memory
  570. allocate the space by making it appear that the memory is no longer in the
  571. system.
  572.  
  573. MAPMEM shows the various types of marks so that you can examine them prior to
  574. a releasing them. As shown in the example, MAPMEM reports a call to MARK with
  575. the owner name "MARK", and the mark name (if any) in the command line area.
  576. The result of a call to FMARK or MARKNET will show "N/A" in the owner column
  577. (due to the minimal memory kept by an FMARK), and the name of the mark file in
  578. the command line area.
  579.  
  580. MAPMEM offers the following command line options:
  581.  
  582.      /V     verbose report.
  583.      /?     write a help screen.
  584.  
  585. The verbose report shows each individual memory block rather than just one for
  586. each program. It also adds two new columns of information. "Mcb" stands for
  587. Memory Control Block. This is a physical address, expressed in hexadecimal,
  588. of the DOS data structure used for managing each block of memory. The MCB
  589. address is typically one less than the address of the program. "Files" reports
  590. the number of files kept open by the TSR. In most cases this will be zero.
  591. When it is non-zero, the maximum number of files opened by the rest of the
  592. programs (including the foreground application) is reduced accordingly.
  593.  
  594. RAMFREE.COM is a tiny program with a single purpose: to tell you how many
  595. bytes of memory are free for the next application. The number it reports is
  596. the same as that reported by the DOS CHKDSK utility. RAMFREE's advantage is
  597. that you don't need to wait for your hard disk to be analyzed before you find
  598. out how much memory is free.
  599.  
  600. DEVICE.EXE reports on device drivers installed by the CONFIG.SYS file. It
  601. shows the memory used by DOS itself, any additional drivers installed in
  602. CONFIG.SYS, and the space used for DOS file handles and buffers. Here is a
  603. simple example of DEVICE output:
  604.  
  605.  Address     Bytes   Name           Hooked vectors
  606. ---------   ------   -------------- --------------
  607. 0070:0BB3        -   CON
  608. 0070:0C68        -   AUX
  609. 0070:0C7A        -   COM1
  610. 0070:0D17        -   PRN
  611. 0070:0D29        -   LPT1
  612. 0070:0E15        -   CLOCK$
  613. 0070:0EE5        -   3 Block Units
  614. 0070:2071        -   LPT2
  615. 0070:2083        -   LPT3
  616. 0070:2095        -   COM2
  617. 0000:2C58    37712   NUL            08 0A 0C 0D 0E 13 25 26 29 31 70 72
  618.                                     73 74 75 76 77
  619. 09A5:0000     3488   0 Block Units
  620. 0A7F:0000       18   EMMXXXX0
  621. 0A7F:0012       46   386MAX$$       20
  622. 0A83:0000      768   1 Block Unit   19
  623. 0AB3:0000      768   1 Block Unit
  624. 0AE3:0000    18256   DOS buffers
  625.  
  626. The devices up to and including NUL are all part of DOS. DEVICE lumps their
  627. memory usage into a single value next to the NUL device. The memory usage
  628. associated with NUL does not include the interrupt vector table, the BIOS data
  629. area, or the low-memory DOS data area. If you wish to add this memory to the
  630. total, just take the hexadecimal segment of the first driver you see (in this
  631. case CON) and multiply it by 16 decimal. When the segment is 0070 as shown,
  632. that adds 1792 bytes to the total space for DOS.
  633.  
  634. Don't expect the sum of the DEVICE bytes to match the bytes reported by MAPMEM
  635. in the row labeled 'config'. MAPMEM's report shows what DOS thinks has been
  636. allocated, but that number isn't complete since some of the memory was used
  637. before DOS was truly loaded. However, you should find that the sum of the
  638. DEVICE bytes, plus all of MAPMEM's memory excluding the 'config' row, equals
  639. the total normal RAM in the system.
  640.  
  641. DEVICE also lumps all of the drivers up to NUL into a single block when it
  642. comes to reporting hooked interrupt vectors. Because WATCH can't be installed
  643. prior to these device drivers, DEVICE must use an empirical technique to
  644. detect which vectors each driver controls. Therefore, some meaningless vectors
  645. may appear in the list. Any vectors that are grabbed by another program after
  646. the driver is loaded will not appear.
  647.  
  648. "Block units" typically refer to disk drives. Any drivers that appear after
  649. the NUL device are in the order that you've entered them in CONFIG.SYS.
  650. Drivers loaded for non-standard hard disks, like SpeedStor, sometimes make odd
  651. entries in the DEVICE report, as shown with "0 Block Units" above. RAM disks
  652. appear more logically: each of the "1 Block Unit" entries above is a VDISK
  653. with the data stored in extended memory.
  654.  
  655. Devices like 386MAX may also cause odd-looking entries: 386MAX puts most of
  656. its code in extended memory, and leaves just a bit behind in normal memory.
  657.  
  658. DEVICE offers the following command line options:
  659.  
  660.      /R     raw report.
  661.      /?     write a help screen.
  662.  
  663. The raw report shows more information about the device drivers, but in a less
  664. convenient format. Here's an example, taken on the same system as the previous
  665. report.
  666.  
  667.  Starting      Next             Strategy   Interrupt   Device
  668.  Address     Hdr Addr   Attr   Entry Pnt   Entry Pnt   Name
  669. ---------   ---------   ----   ---------   ---------   --------
  670. 0000:2C58   0AB3:0000   8004   0000:14C6   0000:14CC   NUL
  671. 0AB3:0000   0A83:0000   0800   0000:00A9   0000:00D4   1 Block Unit
  672. 0A83:0000   0A7F:0012   0800   0000:00A9   0000:00D4   1 Block Unit
  673. 0A7F:0012   0A7F:0000   C000   0000:0036   0000:003B   386MAX$$
  674. 0A7F:0000   09A5:0000   8000   0000:0036   0000:003B   EMMXXXX0
  675. 09A5:0000   0070:0BB3   2000   0000:0012   0000:001D   0 Block Units
  676. 0070:0BB3   0070:0C68   8013   0000:00C6   0000:00D1   CON
  677. 0070:0C68   0070:0D17   8000   0000:00C6   0000:00D7   AUX
  678. 0070:0D17   0070:0E15   A040   0000:00C6   0000:00E6   PRN
  679. 0070:0E15   0070:0EE5   8008   0000:00C6   0000:010C   CLOCK$
  680. 0070:0EE5   0070:0C7A   0840   0000:00C6   0000:0112   3 Block Units
  681. 0070:0C7A   0070:0D29   8000   0000:00C6   0000:00D7   COM1
  682. 0070:0D29   0070:2071   A040   0000:00C6   0000:00EC   LPT1
  683. 0070:2071   0070:2083   A040   0000:00C6   0000:00F4   LPT2
  684. 0070:2083   0070:2095   A040   0000:00C6   0000:00FC   LPT3
  685. 0070:2095   0070:FFFF   8000   0000:00C6   0000:00DD   COM2
  686.  
  687. In this report, the drivers are listed in DOS priority order rather than the
  688. order in which they are loaded in memory. Additional columns describe how DOS
  689. treats each driver. Ray Duncan's book "Advanced MS-DOS" is a good place to
  690. learn more about these details.
  691.  
  692. The DEVICE program assumes that all device drivers are loaded in the
  693. CONFIG.SYS file. That is not the case with the NetWare shell, which patches
  694. itself into the device driver chain. DEVICE will write a warning message and
  695. terminate before reporting the first patched-in driver. The raw device report
  696. will still show all of the devices even in this case.
  697.  
  698.  
  699. EATMEM
  700. ------------------------------------------------------------------------------
  701. EATMEM is a small program that is useful only to software developers. It is a
  702. TSR that consumes a specified amount of memory. Developers can use it to
  703. simulate a system with less memory, or to create a buffer zone between an
  704. application and programs preceding it.
  705.  
  706. The memory used by EATMEM can be freed only by using MARK and RELEASE. Call
  707. EATMEM with a single command line parameter, specifying the (decimal) number
  708. of KILOBYTES to eat up:
  709.  
  710.   EATMEM KiloBytesToEat
  711.  
  712. EATMEM will allow you to eat up all available memory, leading to a system
  713. crash when COMMAND.COM cannot be reloaded. Be sure to calculate how much
  714. memory to use before calling EATMEM.
  715.  
  716.  
  717. Version History
  718. ------------------------------------------------------------------------------
  719. If you're converting to this version from version 2.5 or earlier, be sure to
  720. delete RELEASE.COM, DISABLE.COM, and MAPMEM.COM from your directories. The new
  721. versions are EXE files instead of COM files.
  722.  
  723. See the source code for the programs for more detailed information about
  724. changes.
  725.  
  726. Version 2.9  5/4/89
  727.   MAPMEM - fix problem when EMS is available but none is allocated
  728.   DISABLE - fix problem when TSR to disable is last one loaded
  729.           - disallow disable when patches would overlap (SK+)
  730.           - add /O option to allow disable even for overlap (Periscope)
  731.   RELEASE/RELNET - don't treat file marks as protected marks
  732.  
  733. Version 2.8  3/10/89
  734.   add MARKNET/RELNET
  735.   add DEVICE
  736.   add extended memory reporting to MAPMEM
  737.   add TSR detection capability to DISABLE
  738.   treat file and net marks as protected in RELEASE
  739.   add key stuffing routine to RELEASE
  740.   remove 8259 revector routine from RELEASE (available in RELNET)
  741.  
  742. Version 2.7  3/4/89
  743.   used for limited testing of MARKNET/RELNET
  744.  
  745. Version 2.6  1/15/89
  746.   fix problem in MARK/RELEASE when command processor is EXE file
  747.   convert source to Turbo Pascal 5.0
  748.  
  749. Version 2.5  6/2/87
  750.   version checks to avoid mixing different MARK/RELEASE
  751.  
  752. Version 1.0  1/2/86
  753.   initial version
  754.  
  755. For information about other versions, see the source files.
  756.  
  757.  
  758. Copyright and License Information
  759. ------------------------------------------------------------------------------
  760. The TSR Utilities are copyright (c) 1986,1987,1989 by Kim Kokkonen. All Rights
  761. Reserved.
  762.  
  763. These programs are copyrighted, but license is hereby granted to distribute
  764. them for personal, non-commercial use. You may use them yourself, give them to
  765. your friends or co-workers, or distribute them for a cost-based fee ($10 or
  766. less) as part of a user's group or bulletin board service. If you wish to
  767. distribute these programs as part of a commercial package, please contact us
  768. for a license agreement.
  769.  
  770. These programs are not shareware: we're not asking for a donation. However, if
  771. you request that we send you a new version, we'll ask for $20 to cover our
  772. time and costs. The disk will include the latest version of the TSR Utilities,
  773. including the complete source code.
  774.  
  775. The first (and only) place that we upload new versions of the TSR Utilities is
  776. on CompuServe, the BPROGA forum, in the latest Turbo Pascal library, which at
  777. this time is LIB 2. The executable programs are stored in a file called
  778. TSRCOM.ARC, and the source code is stored in a file called TSRSRC.ARC. From
  779. CompuServe, the programs fan out to public domain bulletin boards around the
  780. world. Unfortunately, due to the transient nature of bulletin boards, we
  781. cannot recommend where besides CompuServe you should call to download the
  782. latest version.
  783.  
  784. The TSR Utilities were written by Kim Kokkonen, with thanks to Neil Rubenking
  785. for the original idea behind MARK and RELEASE. Special thanks to Richard
  786. Wilson and Barry Simon at CalTech for the idea that lead to FMARK, and for
  787. much useful correspondence about the TSR Utilities.
  788.  
  789. You can reach Kim Kokkonen at:
  790.  
  791.      TurboPower Software
  792.      P.O. Box 66747
  793.      Scotts Valley, CA 95066-0747
  794.  
  795.      408-438-8608 (voice only, Monday-Friday 9AM-5PM)
  796.      Compuserve: 72457,2131
  797.